package selectCoursebl;

import java.rmi.RemoteException;
import java.util.ArrayList;

import message.Message;

import dataFactory.DataFactory;

import PO.UserPO;
import VO.CourseVO;
import VO.SelectVO;
import VO.UserVO;
import selectCourseDataService.SelectCourseDataService;
import selectCourseblService.selectCourseblService;

public class SelectCourseController implements selectCourseblService{

	
	public Message selectCourse(ArrayList<SelectVO> courseList,UserVO userVO) {
		SelectCourse sc=new SelectCourse();
		Message message=null;
		try {
			message= sc.selectCourse(courseList, userVO);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}

	
	public Message recordScore(SelectVO selectVO, int score) {
		SelectCourse sc=new SelectCourse();
		Message message=null;
		try {
			message= sc.recordScore(selectVO, score);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}

	public ArrayList<SelectVO> studentShowCourse(UserVO userVO) {
		SelectCourse sc=new SelectCourse();
		ArrayList<SelectVO> voList=null;
		try {
			voList= sc.studentShowCourse(userVO);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return voList;
	}

	
	public ArrayList<SelectVO> teacherShowCourse(UserVO userVO) {
		SelectCourse sc=new SelectCourse();
		ArrayList<SelectVO> voList=null;
		try {
			voList= sc.teacherShowCourse(userVO);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return voList;
	}


	@Override
	public Message quitCourse(SelectVO selectVO) {
		SelectCourse sc=new SelectCourse();
		Message message=null;
		try {
			message= sc.quitCourse(selectVO);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}


	@Override
	public Message start() {
		SelectCourse sc=new SelectCourse();
		Message message=null;
		try {
			message= sc.start();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}


	@Override
	public Message close() {
		SelectCourse sc=new SelectCourse();
		Message message=null;
		try {
			message= sc.close();
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return message;
	}
	
	
}
